Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rdlc.commands
Class GUI

    java.lang.Object
      java.lang.Thread
          rdlc.commands.Command
              rdlc.commands.GUI

All Implemented Interfaces:
  java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener

    public class GUI

extends Command
implements java.lang.Runnable, java.awt.event.ActionListener

This class encapsulates all of the main functionality of the RDLC GUI. It simply creates the window with the appropriate layout, and, when a go button is pressed, schedules a command to be run in separate thread.

Version:
  $Revision: 1.16 $
Author:
  Greg Gibeling

Nested Class Summary
`static class` | `GUI.CommandPanel` Create a swing panel which will contain all of the @{link OptionControl} objects for the given command.
`static class` | `GUI.OptionBool` Option control for a boolean option.
`static class` | `GUI.OptionControl` This class encapsulates the code required to turn a command line option information structure into a swing GUI component, and then manage the data input through that component.
`static class` | `GUI.OptionString` Option control for a string option.

Nested classes/interfaces inherited from class java.lang.Thread
`java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

Field Summary
`protected java.util.Hashtable<javax.swing.JButton,GUI.CommandPanel>` | `buttonTable` Hashtable mapping buttons back to the command panels they come from.
`protected Command` | `command` The current RDLC command object.
`protected javax.swing.JComboBox` | `commandChoiceCB` A combo box to select between shell and map commands.
`protected Catalog<java.lang.String,GUI.CommandPanel>` | `commandTable` Catalog of command panels.
`protected javax.swing.Timer` | `commandTimer` A timer to update the GUI state with respect to the current command.
`protected javax.swing.JPanel` | `currentPanel` The panel being displayed for the current command.
`protected javax.swing.JTextField` | `inputFileTF` A text box for the user to enter the input RDL file
`protected Main` | `main` The main object which invoked this command.
`protected javax.swing.JPanel` | `mainPanel` The main panel, to which the others are added.
`protected Catalog<java.lang.String,javax.swing.JTextField>` | `optionTable` Catalog of global options.
`static int` | `TextFieldHeight` Constant to change the height of text boxes in auto-generated GUI.
`protected javax.swing.JPanel` | `universalPanel` A panel which contains the universal options: those which don't depend on the command type.
`protected javax.swing.JFrame` | `window` A `JFrame` which represents the actual window.

Fields inherited from class rdlc.commands.Command
`commandOptions, errorLog, inputClass, inputFileName, inputPath, manifest, oldErr, options, outputPath, pluginConfigTable, plugins, pluginTable, root`

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`GUI(Main _main, java.lang.String _inputFile, java.lang.Class _inputClass, Catalog<java.lang.String,java.lang.String> _options, java.lang.String[] _commandOptions)`

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent event)` The event handler method, handles command selection, invocation and completion.
`private static javax.swing.SpringLayout.Constraints` | `getConstraintsForCell(int row, int col, java.awt.Container parent, int cols)` Simple helper method.
`java.lang.String` | `getLanguage()` Simple accessor.
`boolean` | `invoke()` Schedule the GUI to be run later by the event handler thread.
`static void` | `makeCompactGrid(java.awt.Container parent, int rows, int cols, int initialX, int initialY, int xPad, int yPad, Log errorLog)` Aligns the first `rows` * `cols` components of `parent` in a grid.
`void` | `run()` The run method for this window, initializes the GUI and starts action listeners.

Methods inherited from class rdlc.commands.Command
`backEndPlugin, end, frontEndPlugins, getCommandName, getErrorLog, getInputClass, getInputPath, getManifest, getOption, getOutputPath, hasErrors, start`

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### TextFieldHeight

    public static final int TextFieldHeight

  Constant to change the height of text boxes in auto-generated GUI.

  See Also:
    Constant Field Values

### window

    protected javax.swing.JFrame window

  A `JFrame` which represents the actual window.

### mainPanel

    protected javax.swing.JPanel mainPanel

  The main panel, to which the others are added.

### universalPanel

    protected javax.swing.JPanel universalPanel

  A panel which contains the universal options: those which don't depend on the command type.

### commandChoiceCB

    protected javax.swing.JComboBox commandChoiceCB

  A combo box to select between shell and map commands.

### inputFileTF

    protected javax.swing.JTextField inputFileTF

  A text box for the user to enter the input RDL file

### optionTable

    protected Catalog<java.lang.String,javax.swing.JTextField> optionTable

  Catalog of global options.

### commandTable

    protected Catalog<java.lang.String,GUI.CommandPanel> commandTable

  Catalog of command panels.

### buttonTable

    protected java.util.Hashtable<javax.swing.JButton,GUI.CommandPanel> buttonTable

  Hashtable mapping buttons back to the command panels they come from.

### currentPanel

    protected javax.swing.JPanel currentPanel

  The panel being displayed for the current command.

### command

    protected Command command

  The current RDLC command object.

### commandTimer

    protected javax.swing.Timer commandTimer

  A timer to update the GUI state with respect to the current command.

### main

    protected Main main

  The main object which invoked this command.

Constructor Detail

### GUI

    public GUI(Main _main,
               java.lang.String _inputFile,
               java.lang.Class _inputClass,
               Catalog<java.lang.String,java.lang.String> _options,
               java.lang.String[] _commandOptions)

See Also:
  `Command.Command(Main, String, Class, Catalog, String[])`

Method Detail

### invoke

    public boolean invoke()

  Schedule the GUI to be run later by the event handler thread.

  Specified by:
    `invoke` in class `Command`
  Returns:
    `true` on success.
  See Also:
    `Command.invoke()`

### run

    public void run()

  The run method for this window, initializes the GUI and starts action listeners. Note that this is invoked later by swing in the event handling thread.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Overrides:
    `run` in class `Command`
  See Also:
    `Command.invoke()`

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent event)

  The event handler method, handles command selection, invocation and completion.

  Specified by:
    `actionPerformed` in interface `java.awt.event.ActionListener`
  Parameters:
    `event` - The action event which occured.

### getConstraintsForCell

    private static javax.swing.SpringLayout.Constraints getConstraintsForCell(int row,
                                                                              int col,
                                                                              java.awt.Container parent,
                                                                              int cols)

  Simple helper method. Gets the layout contraints of a component given the row and column at which it appears in the parent spring layout.

  Parameters:
    `row` - The row of the component.
    `col` - The column of the component.
    `parent` - The parent container which is using spring layout.
    `cols` - The total number of columns, for indexing.
  Returns:
    The layout contraints of the indexed component.

### makeCompactGrid

    public static void makeCompactGrid(java.awt.Container parent,
                                       int rows,
                                       int cols,
                                       int initialX,
                                       int initialY,
                                       int xPad,
                                       int yPad,
                                       Log errorLog)

  Aligns the first `rows` * `cols` components of `parent` in a grid. Each component in a column is as wide as the maximum preferred width of the components in that column; height is similarly determined for each row. The parent is made just big enough to fit them all.

  Parameters:
    `rows` - number of rows
    `cols` - number of columns
    `initialX` - x location to start the grid at
    `initialY` - y location to start the grid at
    `xPad` - x padding between cells
    `yPad` - y padding between cells
    `errorLog` - A list of errors to be reported to the user.

### getLanguage

    public java.lang.String getLanguage()

  Description copied from class: `Command`
  Simple accessor.

  Specified by:
    `getLanguage` in class `Command`
  Returns:
    Get the name of the output language.
  See Also:
    `Command.getLanguage()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD